package com.thenmoret.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thenmoret.mapper.TypeMapper;
import com.thenmoret.pojo.Type;
import com.thenmoret.service.TypeService;

@Service
public class TypeServiceImpl implements TypeService{

	@Autowired
	private TypeMapper typeMapper;
	
	@Override
	public List<Type> findAll() {
		return typeMapper.selectByList();
	}

	@Override
	public List<Type> findByPage(Integer start, Integer end) {
		return typeMapper.selectBypage(start, end);
	}

	@Override
	public Integer AddArticleType(Type type) {
		return typeMapper.insert(type);
	}

	@Override
	public Integer deleteArticleType(Integer id) {
		return typeMapper.deleteByPrimaryKey(id);
	}

	@Override
	public Integer updateArticleType(Type type) {
		return typeMapper.updateByPrimaryKey(type);
	}

}
